package com.chookss.mine.set

import android.os.Build
import android.os.Bundle
import com.chookss.R
import com.chookss.base.StaticClass
import com.chookss.tools.Utils
import com.johnrambo.ktea.ktExtends.ShareUtils
import com.johnrambo.ktea.ktExtends.onclick
import com.johnrambo.ktea.ktExtends.startActivity
import com.lvgroup.hospital.base.BaseAct
import kotlinx.android.synthetic.main.activity_account_security.*
import kotlinx.android.synthetic.main.common_title.*

/*账号安全页面*/
class AccountSecurityActivity : BaseAct() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_account_security)
    }

    override fun initData() {
        initState()
        common_title_txt.text = "账号安全"
        var phone =
            ShareUtils().getString(this@AccountSecurityActivity!!, StaticClass.APPACCOUNT, "")
        if (Utils.isNull(phone)) {
            tvPhone.setText("")
        } else {
            if (phone.toString().length > 10) {
                tvPhone.setText(phone.substring(0, 3) + "****" + phone.substring(7, phone.toString().length))
            } else {
                tvPhone.setText(phone.toString())
            }
        }

        tvEquipment.setText(
            ShareUtils().getString(
                this@AccountSecurityActivity!!,
                StaticClass.DEVICENAME,
                ""
            )
        )
        common_title_back onclick {
            finish()
        }

        rlChangePass onclick {
            startActivity<ChangePassActivity>()
        }
    }
}